<extend name="Public/layout"/>

<block name="style">
    <style type="text/css">
        @media (min-width: 992px) {
            .form select,
            .form textarea,
            .form input[type=text],
            .form input[type=password],
            .form .token-input-list{
                width: 50% !important;
                max-width: 600px;
            }
        }
    </style>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/select2/css/select2.css">
</block>

<block name="script">
    <script type="text/javascript" src="__PUBLIC__/select2/js/select2.min.js" charset="utf-8"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $("#multi_list").select2({
                placeholder: "请选择图文",
                maximumSelectionLength: 9,
                language: "zh-CN"
            });
        });

    </script>
</block>

<block name="body">
    <div class="row">
        <div class="col-xs-12">       
            <form action="__SELF__" method="post" class="form">
                <div class="form-group">
                    <label class="item-label" style='margin-bottom:5px'>选择图文<span class="check-tips">（可以多选）</span></label>
                    <div class="controls" style='margin-bottom:15px'>
                        <select name="ids[]" class="form-control" id="multi_list" multiple="multiple">
                            <volist name="all_news" id="item">

                                <empty name="info.ids">
                                    <option value="{$item.id}" >({$item.create_time|date="Y-m-d",###}){$item.title}</option>
                                    <else /> 
                                    <in name="item.id" value="$info.ids">
                                    <option value="{$item.id}" selected="selected">({$item.create_time|date="Y-m-d",###}){$item.title}</option>
                                    <else/>
                                    <option value="{$item.id}" >({$item.create_time|date="Y-m-d",###}){$item.title}</option>
                                    </in>

                                </empty> 
                            </volist>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="item-label">关键字<span class="check-tips">（关键字）</span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="keyword" value="{$info.keyword|default=''}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="item-label">排序<span class="check-tips">（用于菜单显示的顺序）</span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="sort" value="{$info.sort|default=0}">
                        </div>
                    </div>
                    <div class="form-group">
                        <input type="hidden" name="id" value="{$info.id|default=''}">
                        <button class="btn btn-primary submit ajax-post" type="submit" target-form="form">确 定</button>
                        <button class="btn return" onclick="javascript:history.back(-1);
                                return false;">返 回</button>
                    </div>
            </form>
        </div>
    </div>
</block>

